<template>
  <div class="mat-reference">
    <a target="_blank" :href="handian(ch)">
      <ri i="elink"></ri>
      汉典
    </a>
    <a target="_blank" :href="baidu(ch)">
      <ri i="elink"></ri>
      百度
    </a>
  </div>
</template>

<script>
export default {
  props: ["ch"],
  methods: {
    handian(ch) {
      let url = "https://www.zdic.net/hans/";
      let esc = encodeURIComponent(ch);
      return url + esc;
    },
    baidu(ch) {
      let url = "https://hanyu.baidu.com/zici/s?wd=";
      let esc = encodeURIComponent(ch);
      return url + esc;
    },
  },
};
</script>